import { http } from "@/utils/http";

export type ResultType = ReplaceTargetType<any[] | any>

/**
 * 关系查询列表
 * @param params
 *  code:string 实体类型关系编码
 *  dstId:number 实体类型目的ID
 *  name:string 实体类型关系名称
 *  srcId：number 实体类型源ID
 * @param current number 当前页
 * @param size number 每页的数量
 */
export const getEntityPerel = (params) => {
  return http.request<ResultType>({
    url: "/kgManagerApi/entitytyperel/page",
    method: "get",
    params: {
      ...params
    }
  });
};


/**
 * 关系查询表格
 * @param params
 */
export const getRelationPage = (params) => {
  return http.request<ResultType>({
    url: "/kgManagerApi/kg-manager/manager/conduct-kg/v1.0/relation/bean/page",
    method: "get",
    params: {
      ...params
    }
  });
};

/**
 * 关系详情
 * @param params
 */
export const getRelationDetail = (params) => {
  return http.request<ResultType>({
    url: "/kgManagerApi/kg-manager/manager/conduct-kg/v1.0/relation/bean",
    method: "get",
    params: {
      ...params
    }
  });
};

/**
 * 删除关系
 * @param params
 */
export const deleteRelation = (data) => {
  return http.request<ResultType>({
    url: "/kgManagerApi/kg-manager/manager/conduct-kg/v1.0/relation/remove",
    method: "post",
    data
  });
};


/**
 * 关系编辑
 * @param params
 */
export const updateRelation = (data) => {
  return http.request<ResultType>({
    url: "/kgManagerApi/kg-manager/manager/conduct-kg/v1.0/relation/update",
    method: "post",
    data
  });
};
